/*
 * @Author: Leo.wang wanglizhigs@163.com
 * @Date: 2024-09-02 21:58:14
 * @LastEditors: Leo.wang wanglizhigs@163.com
 * @LastEditTime: 2024-09-03 23:03:33
 * @FilePath: /metaverse-manage/app/router.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// app/router.js
module.exports = app => {
  const { router, controller } = app;
  router.prefix('/api');
  router.get('/model', controller.model.queryAllModels);
  router.get('/model/:id', controller.model.queryModelById);
  router.post('/model', controller.model.createModel);
  router.put('/model/:id', controller.model.updateModel);
  router.delete('/model/:id', controller.model.removeModel);

  router.post('/file/upload', controller.file.upload);

  router.get('/video', controller.video.queryAllVideos);
  router.get('/video/:id', controller.video.queryVideoById);
  router.post('/video', controller.video.createVideo);
  router.put('/video/:id', controller.video.updateVideo);
  router.delete('/video/:id', controller.video.removeVideo);

  // router.get('/user', controller.user.queryAllUsers);
  router.get('/user', controller.user.queryAllUsersByPage);
  router.get('/user/:id', controller.user.queryUserById);
  router.get('/user/phone/:phone', controller.user.queryUserByPhone);
  router.post('/user', controller.user.createUser);
  router.put('/user/:id', controller.user.updateUser);
  router.delete('/user/:id', controller.user.removeUser);
  // router.post('/login', controller.user.loginWhiteWeixin);
  router.post('/app/login', controller.user.login);


  router.get('/manager', controller.manager.queryAllManagers);
  router.get('/manager/:id', controller.manager.queryManagerById);
  router.post('/manager', controller.manager.createManager);
  router.put('/manager/:id', controller.manager.updateManager);
  router.delete('/manager/:id', controller.manager.removeManager);
  router.post('/manager/login', controller.manager.login);


  router.get('/contact', controller.contact.queryAllContacts);
  router.get('/contact/:id', controller.contact.queryContactById);
  router.post('/contact', controller.contact.createContact);
  router.put('/contact/:id', controller.contact.updateContact);
  router.delete('/contact/:id', controller.contact.removeContact);

};
